﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PeoplesJukebox.Core.MediaItems;
using System.Collections.ObjectModel;
using PeoplesJukebox.Core.MediaItems.Bases;
using PeoplesJukebox.Core.Enums;

namespace PeoplesJukebox.Core.Interfaces
{
    /// <summary>
    /// Represents a media catalogue
    /// </summary>
    public interface IMediaCatalogue
    {
        /// <summary>
        /// Gets the list of known artists
        /// </summary>
        List<Artist> Artists { get; }

        /// <summary>
        /// Gets the list of known albums
        /// </summary>
        List<Album> Albums { get; }

        /// <summary>
        /// Gets the list of known tracks
        /// </summary>
        List<Track> Tracks { get; }

        /// <summary>
        /// Searches all media items for the given search term
        /// </summary>
        /// <param name="searchTerm">Search term</param>
        /// <returns>List of matching items</returns>
        List<MediaItem> Search(string searchTerm);

        /// <summary>
        /// Searches media items of the given type for the given search term
        /// </summary>
        /// <param name="searchTerm">Search term</param>
        /// <param name="itemType">Item types to search</param>
        /// <returns>List of matching items</returns>
        List<MediaItem> Search(string searchTerm, MediaItemType itemType);

        /// <summary>
        /// Returns the artist with the given ID
        /// </summary>
        /// <param name="artistId">Artist ID</param>
        /// <returns>Artist</returns>
        Artist GetArtist(int artistId);

        /// <summary>
        /// Returns the albums for the given artist
        /// </summary>
        /// <param name="artistId">Artist ID</param>
        /// <returns>List of artist's albums</returns>
        List<Album> GetAlbumsByArtist(int artistId);

        /// <summary>
        /// Returns the album with the given ID
        /// </summary>
        /// <param name="albumId">Album ID</param>
        /// <returns>Album</returns>
        Album GetAlbum(int albumId);

        /// <summary>
        /// Returns the tracks for the given album
        /// </summary>
        /// <param name="albumId">Album ID</param>
        /// <returns>List of album tracks</returns>
        List<Track> GetTracksByAlbum(int albumId);

        /// <summary>
        /// Returns the tracks for the given artist
        /// </summary>
        /// <param name="artistId">Artist ID</param>
        /// <returns>List of artist's tracks</returns>
        List<Track> GetTracksByArtist(int artistId);

        /// <summary>
        /// Returns a randomly-selected track
        /// </summary>
        /// <returns></returns>
        Track GetRandomTrack();

        /// <summary>
        /// Returns the track with the given ID
        /// </summary>
        /// <param name="trackId">Track ID</param>
        /// <returns>Track</returns>
        Track GetTrack(int trackId);                
    }
}